The spinfoam approach to quantum gravity rests on a "quantization" of BF theory using 2-complexes and group representations. We explain why, in dimension three and higher, this "spinfoam quantization" must be amended to be made consistent with the gauge symmetries of discrete BF theory. We discuss a suitable generalization, called "cellular quantization", which (1) is finite, (2) produces a topological invariant, (3) matches with the properties of the continuum BF theory, (4) corresponds to its loop quantization. These results significantly clarify the foundations - and limitations - of the spinfoam formalism, and open the path to understanding, in a discrete setting, the symmetry-breaking which reduces BF theory to gravity